<template>
	<div>
		<Row>
			<Col class="p-1" :xs="24" :sm="24" :md="12" :lg="8" :xl="6" :xxl="4">
			<Input class="w-100" v-model="searchKey" placeholder="请输入店长姓名" />
			</Col>
		</Row>
		<Row>
			<div class="w-100 d-flex justify-content-end align-items-center ">
				<Button class="m-1" type="primary" shape="circle" @click="searchs" icon="ios-search">查询</Button>
			</div>
		</Row>
		<div v-if="this.tableInfo.data.length == 0" class="d-flex justify-content-center p-1">
			暂无数据
		</div>
		<div v-else>
			<div class="mt-1 ">
				<Row>
					<Col class="p-1" v-for="(row, index) in tableInfo.data"  :xs="24" :sm="24" :md="12" :lg="8" :xl="6" :xxl="6">
					<div class="text-xss rounded shadow overflow-hidden ">
						<div class="p-2 bg-black-80 text-fuguang d-flex text-lg justify-content-start text-blod">
							<span>{{row.dname}}</span>
						</div>
						<div class="p-2 bg-black-50 text-fuguang d-flex justify-content-end">
							<span>{{row.dzid}}</span>
						</div>
						<div class="p-2 bg-black-50 position-relative  d-flex justify-content-between align-items-center">
							<div class="w-25  position-relative">
								<div class="padding-top-100"></div>
								<div class="position-absolute rounded-circle overflow-hidden top0">
									<img class="w-100 h-100" :src="row.cover"/>
								</div>
								
							</div>
							<div class="w-75 ">
								<div class="p-2 d-flex justify-content-end align-items-center ">
									<span class="text-fuguang ">
										<span class="iconfont icon-8"></span>
										<span class="ml-1">{{row.sname}}</span>
									</span>
								</div>
								<div class="p-2 d-flex justify-content-end align-items-center">
									<span class="text-fuguang ">
										<span class="iconfont icon-dianhua"></span>
										<span class="ml-1">{{row.tel}}</span>
									</span>
								</div>
							</div>
						</div>	
							
			
					        <div class="p-2 d-flex justify-content-end bg-black-50 ">
					          <Button class="text-xss ml-2" type="primary" size="small" @click="show(row.dzid)">详细</Button>
					
					        </div>
					      </div>
					    </Col>
					  </Row>
					</div>
			<div>
				<Page class="text-right mt-3" :page-size="tableInfo.pageSize" @on-change="pageSearch"
					:total="tableInfo.total" />
			</div>
		</div>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				searchKey: "",
				tableInfo: {
					currentPage: 1,
					pageSize: 12,
					total: 0,
					data: []
				}
			}
		},
		methods: {
			init: function() {
				this.tableInfo.currentPage = 0;
				this.search();
			},
			show: function(dzid) {
				this.$router.push({
					path: "/dz/detail?id=" + dzid
				})
			},
			remove: function(dzid) {
				this.message.confirm({
					title: "删除提示",
					content: "即将删除场馆，确定吗？",
					onOk: () => {
						this.http.delete({
							url: "/dz/info",
							param: {
								dzid
							}
						}).then(data => {
							this.search();
						});
					},
					onCancel: () => {
						this.message.info('操作已取消');
					}
				});
			},
			searchs: function() {
				this.tableInfo.currentPage = 1;
				this.search();
			},
			search: function() {
				this.http.get({
					url: "/dz/page",
					param: {
						// 传一个当前页
						current: this.tableInfo.currentPage,
						size:this.tableInfo.pageSize,
						searchKey: this.searchKey
					}
				}).then(data => {
					this.tableInfo.data = data.records;
					this.tableInfo.currentPage = data.current;
					this.tableInfo.total = data.total;
					this.tableInfo.pageSize = data.size;
				});
			},
			pageSearch: function(changedPage) {
				this.tableInfo.currentPage = changedPage;
				this.search();
			}
		},
		created: function() {
			this.init();
		}
	}
</script>

<style scoped>

</style>